<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>分类管理-新闻信息管理系统</title>
    <link rel="stylesheet" href="view/assets/css/bootstrap.min.css">
    <script src="view/assets/js/html5shiv.min.js"></script>
    <script src="view/assets/js/respond.min.js"></script>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
</style>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" style="margin: auto;" href="index.php">新闻信息管理系统</a>
            <a class="navbar-brand" style="margin: auto; font-size: 15px;" href="admin.php">首页</a>
            <a class="navbar-brand" style="margin: auto; font-size: 15px;" href="artlist.php">文章管理</a>
            <a class="navbar-brand" style="margin: auto; font-size: 15px;" href="catlist.php">分类管理</a>
            <a class="navbar-brand" style="margin: auto;font-size: 15px;" href="commlist.php">评论管理</a>
            <a class="navbar-brand" style="margin: auto; font-size: 15px;" href="role.php">权限管理</a>
            <a class="navbar-brand" style="margin: auto;font-size: 15px;" href="about.php">关于</a>
        </div>
        <!--跳转后台登录按钮-->
        <div id="navbar" class="navbar-collapse collapse">
            <form class="navbar-form navbar-right">
                <a type="button" class="btn btn-success" href="logout.php">退出</a>
            </form>
        </div>
    </div>
</nav>
<!--头部-->
<div class="jumbotron text-center">
    <div style="margin: 20px;">
        <p>新闻信息管理系统</p><p>分类管理</p>
    </div>
</div>
<div class="container">
    <div class="alert alert-warning text-center">
        <h3>提示</h3>
        <span>1.在这里可以操作分类</span><br>
        <span>2.不可以删除存在文章的分类</span><br>
        <span>3.点此按钮新分类</span><br>
        <a href="catadd.php" class="btn btn-info">添加新分类</a>
    </div>
    <div class="table-responsive">
        <table class="table table-bordered tab-hover">
            <thead>
            <tr>
                <th>ID</th>
                <th>栏目名称</th>
                <th>文章数</th>
                <th>操作</th>
            </tr>
            <tbody>
            <?php foreach($cats as $c)   {?>
            <tr>
                <td><?php echo $num; ?></td>
                <td><?php echo $c['cat_name']; ?></td>
                <td><?php echo $c['cat_num']; ?></td>
                <td><a href="catdel.php?cat_id=<?php echo $c['cat_id']; ?>" onclick="return confirm('确定要删除这个栏目吗？');">删除</a> | <a href="catedit.php?cat_id=<?php echo $c['cat_id']; ?>">编辑</a></td>
            </tr>
            <?php $num = $num + 1;}?>
            </tbody>
        </table>
    </div>
</div>
<div class="jumbotron text-center" style="margin-bottom:0">
    <p>Copyright © 2020-2021 用于数据库实践</p>
</div>
<script src="view/assets/js/jquery.min.js"></script>
<script src="view/assets/js/bootstrap.min.js"></script>
</body>
</html>
